﻿using System;

namespace OpenGameEngine.Base
{
    [Serializable]
    public class GameConfiguration
    {
        public GameConfiguration()
            : this("Example Title")
        { }

        public GameConfiguration(String title)
            : this(title, 800, 600, 60)
        { }

        public GameConfiguration(String title, Int32 width, Int32 height, Int32 ups)
        {
            Title = title;
            Width = width;
            Height = height;
            VSync = false;
            UpdatesPerSecond = ups;
        }

        internal Double _upsms = (1.0 / 60.0);
        private Int32 _ups = 60;
        /// <summary>
        /// Gets or sets the maximum updates per second
        /// </summary>
        public Int32 UpdatesPerSecond
        {
            get { return _ups; }
            set { _ups = value; _upsms = ((double)1 / (double)_ups); }
        }

        /// <summary>
        /// Gets or sets the window title.
        /// </summary>
        public string Title
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the width of the window.
        /// </summary>
        public int Width
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the height of the window.
        /// </summary>
        public int Height
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets a value indicating whether [wait vertical blanking].
        /// </summary>
        /// <value>
        /// 	<c>true</c> if [wait vertical blanking]; otherwise, <c>false</c>.
        /// </value>
        public bool VSync
        {
            get;
            set;
        }

    }
}
